import Vue from 'vue'
import VueRouter from 'vue-router'
const Table = () => import("@/views/table/index.vue")
const Message = () => import("@/views/message/index.vue")
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Message',
    component: Message
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})
// 请求拦截
// router.beforeEach((to, form, next) => {
//   if (to.meta && to.meta.notNeedToken) {
//     return next()
//   } else {
//     let token = getLocalStorage('token');
//     if (!token) {
//       return next({ path: '/login' })
//     } else {
//       return next()
//     }
//   }
// })
export default router
